//+--------------------------------------------------------------------------------
//| Copyright (c) 2012 - 2013 ### an.vuongngocduy
//| This file is a part of Compact Game Engine (CGE)
//+--------------------------------------------------------------------------------
#ifndef __CGE_IMAGETRANSCODER_H__
#define __CGE_IMAGETRANSCODER_H__

#include "cgeCommons.h"
#include "cgeStream.h"
#include "cgeImage.h"

using namespace cge::io;

namespace cge
{
	namespace gfx
	{
		//! Class interface provides methods to load image from stream or write image to stream
		class ImageTranscoder
		{
		public:
			//! Default constructor
			ImageTranscoder(){}


			//! Destructor
			virtual ~ImageTranscoder(){}


			//! Load image from stream
			virtual s8 LoadImage(Stream& inStream, Image& image) const = 0;

			
			//! Write image to stream
			virtual s8 SaveImage(Stream& outStream, const Image& image) const = 0;

		
		protected:
			//! Return descriptor of image
			Image::Descriptor* lockOn(Image& image) const
			{
				return &(image.mDesc);
			}
		};
	}
}

#endif//__CGE_IMAGETRANSCODER_H__